/**
*      author: Y_Yao
*      created: 2024-11-22 20:14:33
**/

#include<bits/stdc++.h>

using namespace std;
using LL = long long;
const LL LLINF = 1e18;
const int INF = 0x3f3f3f3f;

void solve()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    string t = " ";
    s = t + s;

    int ret = 1;
    for(int i = 1;i <= n;i++)
    {
        if(s[i] == '/')
        {
            int ans = 1;
            int left = i - 1,right = i + 1;
            while(left >= 1 && right <= n && s[left] == '1' && s[right] == '2')
            {
                ans += 2;
                left--;
                right++;
            }
            ret = max(ret,ans);
        }
    }
    cout << ret << endl;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}